package com.example.aixiangshou.runninggame;

/**
 * @author: X_Meteor
 * @description: 类描述
 * @version: V_1.0.0
 * @date: 2018/5/14 14:12
 * @company:
 * @email: lx802315@163.com
 */

import android.content.Context;
import android.widget.ArrayAdapter;

import java.util.List;

/**
 * 给下拉框的适配器
 * Created by IBM on 2016/10/25.
 */

public class simpleArrayAdapter<T> extends ArrayAdapter {
    //构造方法
    public simpleArrayAdapter(Context context, int resource, List<T> objects) {
        super(context, resource, objects);
    }

    //复写这个方法，使返回的数据没有最后一项
    @Override
    public int getCount() {
        // don't display last item. It is used as hint.
        int count = super.getCount();
        return count > 0 ? count - 1 : count;
    }

}
